/**
 * MarioEnemy_IakituAI
 * @extends MarioAI
 * @version 2010.12.04
 */

class MarioEnemy_IakituAI extends MarioAI;

state Patrolling
{
	/**
	 * SeePlayer
	 * @version 2010.12.04
	 */
	event SeePlayer(Pawn SeenPlayer)
	{
		if(playercontroller(SeenPlayer.controller) == None)
			return;
		thePlayer = SeenPlayer;
		`log("SEE YOU!");
	}

	Begin:
	distanceToPlayer = VSize(thePlayer.Location - Pawn.Location);
	if(distanceToPlayer <= 70)
	{
		//thePlayer.Destroyed();
		thePlayer.Suicide();
		`log("DEAD! BANG BANG!");
		Pawn.Acceleration = vect(0, 0, 0);
   }
   /*
	else if(distanceToPlayer < perceptionDistance)
	{ 
		Pawn.Acceleration = vect(0,0,0);
	}
	*/
	else
	{
		Pawn.MaxDesiredSpeed = 0.3;
		MoveToward(thePlayer, thePlayer);
	}

	LatentWhatToDoNext();
}

